home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / Tool Chest / Development Platforms / MPW Related / MPW Interfaces / PInterfaces / CTBUtilities.p < prev    next >
Encoding:
Text File  |  1993-09-17  |  3.2 KB  |  148 lines  |  [TEXT/MPS ]

  1. {
  2.     File:        CTBUtilities.p
  3.  
  4.     Copyright:    © 1983-1993 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Version:    System 7.1 for ETO #11
  8.     Created:    Tuesday, March 30, 1993 18:00
  9.  
  10. }
  11.  
  12. {$IFC UNDEFINED UsingIncludes}
  13. {$SETC UsingIncludes := 0}
  14. {$ENDC}
  15.  
  16. {$IFC NOT UsingIncludes}
  17.     UNIT CTBUtilities;
  18.     INTERFACE
  19. {$ENDC}
  20.  
  21. {$IFC UNDEFINED UsingCTBUtilities}
  22. {$SETC UsingCTBUtilities := 1}
  23.  
  24. {$I+}
  25. {$SETC CTBUtilitiesIncludes := UsingIncludes}
  26. {$SETC UsingIncludes := 1}
  27. {$IFC UNDEFINED UsingMemory}
  28. {$I $$Shell(PInterfaces)Memory.p}
  29. {$ENDC}
  30. {$IFC UNDEFINED UsingStandardFile}
  31. {$I $$Shell(PInterfaces)StandardFile.p}
  32. {$ENDC}
  33. {$IFC UNDEFINED UsingAppleTalk}
  34. {$I $$Shell(PInterfaces)AppleTalk.p}
  35. {$ENDC}
  36. {$SETC UsingIncludes := CTBUtilitiesIncludes}
  37.  
  38. CONST
  39.  
  40. { version of Comm Toolbox Utilities }
  41. curCTBUVersion        = 2;
  42.  
  43. {    Error codes/types    }
  44. ctbuGenericError    = -1;
  45. ctbuNoErr            = 0;
  46.  
  47. TYPE
  48. CTBUErr = OSErr;
  49.  
  50. CONST
  51.  
  52. {    Choose return codes}
  53. chooseDisaster        = -2;
  54. chooseFailed        = -1;
  55. chooseAborted        =  0;
  56. chooseOKMinor        =  1;
  57. chooseOKMajor        =  2;
  58. chooseCancel        =  3;
  59.  
  60. {    NuLookup return codes    }
  61. nlOk                =    0;
  62. nlCancel            =    1;
  63. nlEject                =    2;
  64.  
  65. {    Name filter proc return codes    }
  66. nameInclude            =    1;
  67. nameDisable            =    2;
  68. nameReject            =    3;
  69.  
  70. {    Zone filter proc return codes    }
  71. zoneInclude            =    1;
  72. zoneDisable            =    2;
  73. zoneReject            =    3;
  74.  
  75. {    Values for hookProc items        }
  76. hookOK                =    1;
  77. hookCancel             =    2;
  78. hookOutline            =    3;
  79. hookTitle            =    4;
  80. hookItemList        =    5;
  81. hookZoneTitle        =    6;
  82. hookZoneList        =    7;
  83. hookLine            =    8;
  84. hookVersion            =    9;
  85. hookReserved1        =    10;
  86. hookReserved2         =    11;
  87. hookReserved3        =    12;
  88. hookReserved4        =    13;
  89.  
  90. {    "virtual" hookProc items    }
  91. hookNull            =    100;
  92. hookItemRefresh        =    101;
  93. hookZoneRefresh        =    102;
  94. hookEject            =    103;
  95. hookPreflight        =    104;
  96. hookPostflight        =    105;
  97. hookKeyBase            =    1000;
  98.  
  99. TYPE
  100. {    NuLookup structures/constants    }
  101. NLTypeEntry = RECORD
  102.     hIcon: Handle;
  103.     typeStr: Str32;
  104.  END;
  105.  
  106.  
  107. NLType         = ARRAY [0..3] OF NLTypeEntry;
  108.  
  109. NBPReply = RECORD
  110.     theEntity:    EntityName;
  111.     theAddr:    AddrBlock;
  112.  END;
  113.  
  114.  
  115. NameFilterProcPtr = ProcPtr;
  116. ZoneFilterProcPtr = ProcPtr;
  117.  
  118.  
  119. FUNCTION    InitCTBUtilities: CTBUErr;
  120. FUNCTION    CTBGetCTBVersion: INTEGER;
  121.  
  122.  
  123. FUNCTION    StandardNBP(where: Point;prompt: Str255;numTypes: INTEGER;typeList: NLType;
  124.                  nameFilter: NameFilterProcPtr;zoneFilter: ZoneFilterProcPtr;hookProc: DlgHookProcPtr;
  125.                  VAR theReply: NBPReply): INTEGER;
  126.  
  127. FUNCTION    CustomNBP(where: Point;prompt: Str255;numTypes: INTEGER;typeList: NLType;
  128.                nameFilter: NameFilterProcPtr;zoneFilter: ZoneFilterProcPtr;hookProc: DlgHookProcPtr;
  129.                userData: LONGINT;dialogID: INTEGER;filterProc: ModalFilterProcPtr;VAR theReply: NBPReply): INTEGER;                   
  130.  
  131.  
  132. { Obsolete synonyms for above routines }
  133. FUNCTION    NuLookup(where: Point;prompt: Str255;numTypes: INTEGER;typeList: NLType;
  134.                  nameFilter: NameFilterProcPtr;zoneFilter: ZoneFilterProcPtr;hookProc: DlgHookProcPtr;
  135.                  VAR theReply: NBPReply): INTEGER;
  136.  
  137. FUNCTION    NuPLookup(where: Point;prompt: Str255;numTypes: INTEGER;typeList: NLType;
  138.                nameFilter: NameFilterProcPtr;zoneFilter: ZoneFilterProcPtr;hookProc: DlgHookProcPtr;
  139.                userData: LONGINT;dialogID: INTEGER;filterProc: ModalFilterProcPtr;VAR theReply: NBPReply): INTEGER;
  140.                
  141.  
  142. {$ENDC}    { UsingCTBUtilities }
  143.  
  144. {$IFC NOT UsingIncludes}
  145.     END.
  146. {$ENDC}
  147.  
  148.